package cn.aixuegao.common.result;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 返回的json的基类
 * @author hxy
 * @date 2018/3/22
 */
@ApiModel(subTypes={ResponseData.class})
public class Response {
	/** 返回信息码*/
	@ApiModelProperty(name="后台相应的状态码",notes="状态码都为六位数",example="000000")
	private String rspCode="000000";
	/** 返回信息内容*/
	@ApiModelProperty(name="对状态码的描述",notes="对状态码的描述信息",example="操作成功")
	private String rspMsg="操作成功";

	/**
	 * 以下为Response的各种构造方
	 */
	
	public Response() {
	}
	
	public Response(ResultMsg msg){
		this.rspCode=msg.getCode();
		this.rspMsg=msg.getMsg();
	}
	
	public Response(String rspCode) {
		this.rspCode = rspCode;
		this.rspMsg = "";
	}

	public Response(String rspCode, String rspMsg) {
		this.rspCode = rspCode;
		this.rspMsg = rspMsg;
	}
	public String getRspCode() {
		return rspCode;
	}
	public void setRspCode(String rspCode) {
		this.rspCode = rspCode;
	}
	public String getRspMsg() {
		return rspMsg;
	}
	public void setRspMsg(String rspMsg) {
		this.rspMsg = rspMsg;
	}

	@Override
	public String toString() {
		return "Response{" +
				"rspCode='" + rspCode + '\'' +
				", rspMsg='" + rspMsg + '\'' +
				'}';
	}
}
